.class Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;
.super Ljava/lang/Thread;
.source "DisplayTrackInMapPolygon.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "LoadPolygons"
.end annotation


# instance fields
.field opts:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/PolygonOptions;",
            ">;"
        }
    .end annotation
.end field

.field private running:Z

.field private spraying:Z

.field final synthetic this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;


# direct methods
.method public constructor <init>(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)V
    .locals 0

    .line 59
    iput-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public declared-synchronized cancel()V
    .locals 1

    monitor-enter p0

    const/4 v0, 0x0

    .line 68
    :try_start_0
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->running:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 69
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized isRunning()Z
    .locals 1

    monitor-enter p0

    .line 64
    :try_start_0
    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->running:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public run()V
    .locals 4

    .line 80
    invoke-super {p0}, Ljava/lang/Thread;->run()V

    .line 82
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->isRunning()Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    .line 84
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    new-instance v1, Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$100(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object v2

    invoke-virtual {v2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getImpelement()D

    move-result-wide v2

    invoke-direct {v1, v2, v3}, Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;-><init>(D)V

    invoke-static {v0, v1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$002(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;)Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;

    .line 86
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->isRunning()Z

    move-result v0

    if-nez v0, :cond_1

    return-void

    .line 88
    :cond_1
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$100(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object v0

    if-eqz v0, :cond_a

    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$100(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getTracks()Ljava/util/List;

    move-result-object v0

    if-eqz v0, :cond_a

    .line 91
    new-instance v0, Ljava/util/ArrayList;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    invoke-static {v1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$100(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getTracks()Ljava/util/List;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    .line 94
    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_2
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_5

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Llt/noframe/gpsfarmguide/sprayer/track/ObjTrackPoint;

    .line 95
    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/sprayer/track/ObjTrackPoint;->isSprayed()Z

    move-result v2

    if-eqz v2, :cond_3

    const/4 v2, 0x1

    .line 96
    iput-boolean v2, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->spraying:Z

    .line 97
    iget-object v2, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    invoke-static {v2}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$000(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;

    move-result-object v2

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/sprayer/track/ObjTrackPoint;->getCoordinate()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    invoke-virtual {v2, v1}, Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;->sprayPoint(Lcom/google/android/gms/maps/model/LatLng;)V

    goto :goto_0

    .line 99
    :cond_3
    iget-boolean v1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->spraying:Z

    if-eqz v1, :cond_4

    .line 100
    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    invoke-static {v1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$000(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;->pauseSpraying()V

    :cond_4
    const/4 v1, 0x0

    .line 102
    iput-boolean v1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->spraying:Z

    .line 105
    :goto_0
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->isRunning()Z

    move-result v1

    if-nez v1, :cond_2

    return-void

    .line 110
    :cond_5
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$000(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayer;->getPoly()Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->opts:Ljava/util/List;

    .line 111
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->opts:Ljava/util/List;

    if-eqz v0, :cond_9

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-nez v0, :cond_6

    goto :goto_1

    .line 114
    :cond_6
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->isRunning()Z

    move-result v0

    if-nez v0, :cond_7

    return-void

    .line 115
    :cond_7
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$100(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->calculateCorrdinates()V

    .line 116
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->isRunning()Z

    move-result v0

    if-nez v0, :cond_8

    return-void

    .line 119
    :cond_8
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->this$0:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->access$300(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;)Landroid/os/Handler;

    move-result-object v0

    new-instance v1, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons$1;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons$1;-><init>(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    :cond_9
    :goto_1
    return-void

    .line 89
    :cond_a
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Track given to PolygonsDisplayer is null or it\'s track list is null"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    goto :goto_3

    :goto_2
    throw v0

    :goto_3
    goto :goto_2
.end method

.method public declared-synchronized start()V
    .locals 1

    monitor-enter p0

    const/4 v0, 0x1

    .line 74
    :try_start_0
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon$LoadPolygons;->running:Z

    .line 75
    invoke-super {p0}, Ljava/lang/Thread;->start()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 76
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method
